package cn.tedu.design;
/**
 * @author SWJ
 * @create 2021-06-11 16:00
 * 本类设计老师类
 * 要求：面向抽象编程---是后天  向上抽取形成的结果
 */
public class DesignTeacher1 {
    public static void main(String[] args) {
        CgbTeacher cg=new CgbTeacher();
        cg.ready();
        cg.teach();
    }

}

abstract  class Teacher{
    int id;
    String name;
    public abstract void ready();
    /**抽象方法*/
    public abstract void teach();

}
/**
 * 创建培优老师类
 * 调用Teacher()方法继承
 * 子类继承抽象父类要复写所有父类方法
 */
class CgbTeacher extends Teacher {
    @Override
    public void ready() {
        System.out.println("ready方法CgbTeacher");
    }

    @Override
    public void teach() {
        System.out.println("teach方法CgbTeacher");
    }
}

class AdtTeacher extends Teacher{
    @Override
    public void ready() {
        System.out.println("ready方法AdtTeacher");
    }

    @Override
    public void teach() {
        System.out.println("teach方法AdtTeacher");
    }
}
class CedTeacher extends Teacher{
    @Override
    public void ready() {
        System.out.println("ready方法CedTeacher");
    }

    @Override
    public void teach() {
        System.out.println("teach方法CedTeacher");
    }
}
